home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 029a / sprbrow.zip / BROWTEST.PRG next >
Text File  |  1991-06-19  |  3KB  |  99 lines

  1. select a
  2. use person index person
  3. select b
  4. use children index children
  5. set relation to no into person
  6. select person
  7. clear
  8. text
  9.  
  10.  
  11.   
  12.   
  13.   
  14.  
  15.     this is a demonstration of superbrowze selecting a record in an indexed
  16. file. this file is indexed on no. when you are in the no field you can enter
  17. a number to have it jump to that record immediately (even if there are 
  18. thousands of records) because it is indexed. you can also move the cursor
  19. over to the next field and locate on a value in that field. however, since
  20. the file is not indexed on this field, the search will be much slower on
  21. a large file. the num field is used to illustrate that the locate works
  22. on numeric fields as if they were character (searching from the leftmost
  23. character). entering 1 will find 1,10-19, etc., the first record beginning
  24. with 1. Once a locate has been done, the message "F5: Next: " and the
  25. locate scope. You can press F5 to find the next record in the locate scope.
  26. When the last record has been reached, or you press a key that changes or
  27. cancels the locate scope, this message disappears and F5 no longer works.
  28.  
  29. endtext    
  30. wait window " press return to continue.."
  31. clear
  32. store "no" to fld1
  33. do browze with "Select Member Family","no,name,num"
  34. if lastkey()=27
  35.    wait window " cancelled - press return "
  36.    cancel
  37. endif
  38. wait window " selected: "+name+" press return "
  39. clear
  40. text
  41.  
  42.  
  43.  
  44.  
  45.  
  46.    Now the browse will show records in a detail file which are indexed
  47.    by no+upper(name). the browse is limited only to records whose no
  48.    matches the no of the person you just selected. because of this
  49.    limitation, you can not move to the next field and locate on it.
  50.    
  51. endtext
  52. wait window " press return to continue.."   
  53. clear
  54. store no to keyfld
  55. select children
  56. store "name" to fld1
  57. store .t. to indx,srchkey
  58. do browze with "Select Member for Family "+person->name,"name,relation,birth"
  59. if lastkey()=27
  60.    wait window " Cancelled - press return "
  61. else
  62.    wait window " Selected: "+name+" press return "
  63. endif
  64. clear
  65. text
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.    Now a demonstration of multiple selects, where you can select
  73. multiple records with one call to browze. Each return selects the
  74. current record (or unselects it) and moves to the next one. Pressing
  75. ESC cancels the browze, F2 ends the browze. here you can also do a
  76. locate on the other fields, including the birth date field. You can't
  77. locate on the street field because this belongs to the Person file
  78. and the active database is the Children file. You can use a 
  79. combination of F5 and enter to mark all records for a locate scope. 
  80. Try entering F, pressing enter to mark it and then pressing F5 and 
  81. enter repeatedly. All records for which the name begins with F will 
  82. be marked.
  83.  
  84. endtext
  85. wait window " press return to continue.."
  86. clear
  87. replace all selected with .f.
  88. go top
  89. store .f. to indx                && file is not indexed on first field
  90. do browze with "Select Member Records",;
  91. "name,relation,birth,person->street :h='*Street'",.t.
  92. if lastkey()=27
  93.    wait window " cancelled - press return "
  94. else
  95.    clear
  96.    @ 1,20 say "these records were selected: "
  97.    list for selected
  98. endif
  99. close databases